[id].vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <!-- 页面头部 -->
  3. <HomePageHead></HomePageHead>
  4. <!-- Banner1 -->
  5. <HomeBanner1></HomeBanner1>
  6. <!-- 面包屑导航 -->
  7. <div class="breadcrumb">
  8. <div class="inner">
  9. <span class="location">当前位置:</span>
  10. <el-breadcrumb :separator-icon="ArrowRight">
  11. <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
  12. <el-breadcrumb-item :to="{ path: `/primaryNavigation/${listid}` }" v-show="name">{{name}}</el-breadcrumb-item>
  13. <el-breadcrumb-item>{{ routeNewsTtitle }}</el-breadcrumb-item>
  14. </el-breadcrumb>
  15. </div>
  16. </div>
  17. <!-- 资讯列表 -->
  18. <div class="newsDetail">
  19. <div class="inner">
  20. <div class="innerLeft">
  21. <!-- <div class="LeftTop">
  22. <h1>{{ newsDetail.list_title }}</h1>
  23. </div> -->
  24. <div class="leftBottomTitle">{{ newsDetail.list_title }}</div>
  25. <div class="leftBottom" v-html="newsDetail.content"></div>
  26. </div>
  27. <div class="innerRight">
  28. <div class="rightMenuTitle">导航列表</div>
  29. <ul>
  30. <li v-for="(item, index) in bottomMenu" :key="index">
  31. <NuxtLink :to="`/newsDetail/${item.id}`" target="_blank" v-if="item.id==pageId" class="active">{{ item.name }}</NuxtLink>
  32. <NuxtLink :to="`/newsDetail/${item.id}`" target="_blank" v-else>{{ item.name }}</NuxtLink>
  33. </li>
  34. </ul>
  35. </div>
  36. <div style="clear: both;"></div>
  37. </div>
  38. </div>
  39. <!-- 页面底部 -->
  40. <HomeFoot></HomeFoot>
  41. </template>
  42. <script setup>
  43. import { onMounted } from 'vue'
  44. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  45. import { ArrowRight } from '@element-plus/icons-vue'
  46. const nuxtApp = useNuxtApp();
  47. const axios = nuxtApp.$axios;
  48. //获得跳转过来的id
  49. const route = useRoute();
  50. const articleId = route.params.id; //获得该页面的id
  51. const listid = route.query.listId; //获得该页面的id
  52. const name = route.query.listName; //获得该页面的id
  53. const newsDetail = ref({})
  54. console.log(articleId)
  55. const routeNewsTtitle = ref("");
  56. //获取详情
  57. const getNewsInfo = async () => {
  58. const response = await axios.get(`/web/getWebsiteFooterCategoryInfo?fcat_id=${articleId}`);
  59. newsDetail.value = response.data;
  60. console.log(newsDetail.value.title)
  61. if(newsDetail.value.title.length > 30){
  62. routeNewsTtitle.value = newsDetail.value.title.substr(0,30) + "...";
  63. }
  64. }
  65. //获得底部导航
  66. const bottomMenu = ref([]);
  67. const getBottomMenu = async () => {
  68. const response = await axios.get(`/web/getWebsiteFooterCategory`);
  69. bottomMenu.value = response.data;
  70. }
  71. onMounted(()=>{
  72. //获得详情
  73. getNewsInfo()
  74. // 获得左侧导航
  75. getBottomMenu()
  76. })
  77. </script>
  78. <style lang="less" scoped>
  79. //导航条
  80. .breadcrumb {
  81. width: 100%;
  82. height: 22px;
  83. margin-bottom: 30px;
  84. font-family: Microsoft YaHei, Microsoft YaHei;
  85. font-weight: 400;
  86. font-size: 20px;
  87. color: #666666;
  88. line-height: 23px;
  89. text-align: left;
  90. font-style: normal;
  91. text-transform: none;
  92. .el-breadcrumb::v-deep{
  93. display: inline-block;
  94. vertical-align: -4px;
  95. }
  96. /deep/.el-breadcrumb__inner a,
  97. /deep/.el-breadcrumb__inner.is-link {
  98. color: #666666;
  99. font-weight: 400;
  100. text-decoration: none;
  101. transition: var(--el-transition-color);
  102. }
  103. span {
  104. font-family: Microsoft YaHei, Microsoft YaHei;
  105. font-weight: 400;
  106. font-size: 20px;
  107. color: #666666;
  108. line-height: 23px;
  109. text-align: left;
  110. font-style: normal;
  111. text-transform: none;
  112. }
  113. span:hover {
  114. color: #666666;
  115. }
  116. .location {
  117. margin-right: 20px;
  118. width: 100px;
  119. height: 22px;
  120. font-family: Microsoft YaHei, Microsoft YaHei;
  121. font-weight: 400;
  122. font-size: 20px;
  123. color: #666666;
  124. line-height: 23px;
  125. text-align: left;
  126. font-style: normal;
  127. text-transform: none;
  128. }
  129. }
  130. // 资讯列表
  131. .newsDetail {
  132. width: 100%;
  133. //height: 1400px;
  134. margin-bottom: 70px;
  135. .inner {
  136. width: 1200px;
  137. //height: 1400px;
  138. font-size: 16px;
  139. .innerLeft {
  140. //height: 1400px;
  141. float:right;
  142. .LeftTop {
  143. //height: 522px;
  144. margin-top: 50px;
  145. >h1 {
  146. line-height: 40px;
  147. margin-bottom: 30px;
  148. font-family: Microsoft YaHei, Microsoft YaHei;
  149. font-weight: bold;
  150. font-size: 30px;
  151. color: #333333;
  152. }
  153. >p {
  154. height: 18px;
  155. line-height: 18px;
  156. font-family: Microsoft YaHei, Microsoft YaHei;
  157. font-weight: 400;
  158. font-size: 14px;
  159. color: #999999;
  160. span {
  161. margin-right: 40px;
  162. }
  163. }
  164. >img {
  165. width: 680px;
  166. height: 382px;
  167. padding: 50px 0px 60px 55px;
  168. }
  169. }
  170. .leftBottomTitle {
  171. color: #028E21;
  172. font-size: 20px;
  173. font-weight: bold;
  174. height: 60px;
  175. line-height: 60px;
  176. }
  177. .leftBottom {
  178. width: 790px;
  179. height: 754px;
  180. font-size: 20px;
  181. border-top: 1px solid #139602;
  182. padding-top: 40px;
  183. >h3,>p{
  184. text-indent: 2em;
  185. width: 790px;
  186. font-family: Microsoft YaHei, Microsoft YaHei;
  187. font-size: 20px;
  188. color: #333333;
  189. line-height: 23px;
  190. padding-bottom: 30px;
  191. }
  192. >h3 {
  193. font-weight: 600px;
  194. }
  195. >p {
  196. font-weight: 400;
  197. }
  198. }
  199. }
  200. .innerRight {
  201. width: 279px;
  202. .rightMenuTitle {
  203. width: 279px;
  204. height: 69px;
  205. font-size: 22px;
  206. font-weight: bold;
  207. line-height: 58px;
  208. text-align: center;
  209. color: #fff;
  210. background: url("../../static/special/projectMoreTitle.png") no-repeat;
  211. margin-bottom: 30px;
  212. }
  213. ul {
  214. li {
  215. a {
  216. border-left: 5px solid #028E21;
  217. margin-bottom: 15px;
  218. font-size: 22px;
  219. display: block;
  220. height: 61px;
  221. line-height: 61px;
  222. color: #333333;
  223. text-align: center;
  224. background: #FBFBFB;
  225. }
  226. }
  227. }
  228. .active {
  229. border-left: 0;
  230. border: 1px solid #028E21;
  231. background: #fff;
  232. }
  233. }
  234. }
  235. }
  236. </style>